// 引入vue
import Vue from "vue";
// 引入vue-router插件
import VueRouter from "vue-router";
// 引入子路由组件
import HomeView from "../views/HomeView.vue";
import SecondView from "../views/SecondView.vue";
// 注册路由插件
Vue.use(VueRouter);
// 定义路由规则
const routes = [
  {
    path: "/home", // 路径
    component: HomeView,
  },
  {
    path: "/about",
    component: SecondView,
  },
];
// 实例化VueRouter
const router = new VueRouter({
  // 路由规则集合
  routes,
});
// 暴露出实例好的的对象router
export default router;
